
def demo1():
    string=input()
    lists=[]
    str=[]
    for c in string:
        if c!=' ':
            str.append(c);
        else:
            lists.append(str)
            str=[]
    for i in range(len(lists)):
        for j in lists[len(lists)-i-1]:
            print(j,end="")
        print(" ",end="")


if __name__ == '__main__':
    demo1()